package com.wt.springboot.service;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IDEA
 * Describe:
 * Author:TianJi
 * Date:2018/11/20
 * Time:19:30
 */
@Service
public class ScheduledService {

    @Scheduled(cron = "0/1 * * * * MON-FRI")
    public void sayHello(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("hello world....."+sdf.format(new Date()));
    }
}
